package com.java2018.springmvc.utils.entity;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JsonResponse {
    private Boolean error; //是否错误
    private String msg;  //信息
    private Map<String,Object> dataMap = new HashMap<>(); //数据
    public Map<String,Object> getData() {
        return dataMap;
    }

//    public void setData(List<Object> dataList) {
//        this.dataList = dataList;
//    }
    public void addData(String name,Object data){
        this.dataMap.put(name,data);
    }

    public JsonResponse(){
        this.error = true;
        this.msg = "出错啦！！";
    }

    public Boolean getError() {
        return error;
    }

    public void setError(Boolean error) {
        this.error = error;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
